function getPages(page, pageCount, pagesLength) {
  // pages数组
  var pages = [page];
  var left = page - 1;
  var right = page + 1;

  var minNum = Math.min(pageCount, pagesLength);

  // while循环 如果等于话 已经取够了 必须要小于
  while (pages.length < minNum ) {
    if (left > 0) {
      pages.unshift(left);
      left--
    }
    // 如果等于话 已经取够了 必须要用小于
    if (right <= pageCount && pages.length < minNum ) {
      pages.push(right);
      right++
    }
  }
  return pages;
};

module.exports.getPages = getPages;
